<template>
	<view class="team">
		<view class="total dev-box">
			<view >推广总收益：<text class="money">{{sumDaoliMoney}}</text></view>
			<view >推广总人数：<text class="money">{{usersNum}}</text></view>
			<view >今日推广：  <text class="money">{{dayUsersNum}}</text></view>
			
			<view class="level">
				<text class="iconfont" style="color:#ffd12b;margin-right: 10upx;">&#xe642;</text>{{upgradeMsg}}
			</view>
			</view>
		<view class="item dev-box" v-for="(item, index) in teams" :key="index" @click="onClick(item)">
			<view class="base-info">
				<view class="headImg">
					<image v-if="item.headImg" :src="item.headImg"></image>
					<image v-else src="https://cmtq-1317574530.cos.ap-guangzhou.myqcloud.com/img2023/myIcon/head.png"></image>
				</view>
				<view class="u-info">
					<view>
						{{item.userId}}
					</view>
					<view>
						注册时间：{{formatCreateTime(item.createTime)}}
					</view>
					<view>
						会员类型：{{item.vip}}
					</view>
				</view>
			</view>
			
			
		</view>
	</view>
</template>

<script>
import mEmptyData from '@/components/m-empty-data/m-empty-data.vue';
import { formatDate } from '@/common/date';
export default {
	name: 'yzb-team',
	props: {
		teams: Array,
		sumDaoliMoney:{
			value: Number,
			default: 0
		},
		upgradeMsg:{
			value: String,
			default: ""
		},
		usersNum:{
			value: Number,
			default: 0
		},
		dayUsersNum:{
			value:Number,
			default:0
		}
		
	},
	components: {
		mEmptyData
	},
	data() {
		return {
			no_order_1: this.$mAssetsPath.no_order_1
		};
	},

	methods: {
		onClick(item) {
			this.$emit('click', item);
			
		},

		formatCreateTime(time) {
			if (time == null || time === '') {
				return null;
			}
			let str = time.replace(/-/g,'/');
			let date = new Date(str);
			return formatDate(date, 'MM月dd日');
		},
		
		formatDistance(distance){
			if(distance){
				let a=parseFloat(distance);
				if(a>0){
					return distance.toFixed(2)+"km"
				}else{
					return a * 1000 +"m";
				}
			}
			return '0km';
		},
	}
};
</script>

<style lang="scss">
.team {
	padding-bottom:50upx;
	.total{
		padding:10upx 4%;
		.money{
			margin-left:10upx;
			color:#36B957;
		}
	}
	.mark{
		color:white;
		font-size: 35upx;
		line-height: 80upx;
		width:90upx;
		text-align: center;
	}
	.item {
		background-image: url('https://cmtq-1317574530.cos.ap-guangzhou.myqcloud.com/img2023/myIcon/VIP.png');
		background-position: top right;
		background-size: 90upx 90upx;
		background-repeat: no-repeat;
		background-color: $bgcolor_white;
		padding: 30upx;
		// margin-bottom: 20upx;
	}
	.base-info{
		display: flex;
		flex-direction: row;
		.headImg{
			flex:1;
			image{
				width:170upx;
				height:170upx;
				border-radius: 50%;
				overflow: hidden;
			}
		}
		.u-info{
			flex:2;
		}
	}
	.level{
		width:100%;;
		color:#36B957;
		font-size: 26upx;;
	}
}
</style>
